package com.situ.mall.pattern.observer2;

import com.situ.mall.pattern.observer.NewsPaper;
import com.situ.mall.pattern.observer.Reader;

public class Demo {
    public static void main(String[] args) {
        com.situ.mall.pattern.observer.NewsPaper newsPaper = new NewsPaper();
        com.situ.mall.pattern.observer.Reader reader1=new com.situ.mall.pattern.observer.Reader("张三");
        com.situ.mall.pattern.observer.Reader reader2=new com.situ.mall.pattern.observer.Reader("李四");
        com.situ.mall.pattern.observer.Reader reader3=new Reader("王五");
        newsPaper.attach(reader1);
        newsPaper.attach(reader2);
        newsPaper.attach(reader3);

        newsPaper.setContent("观察者模式");
    }
}
